	<script type="text/javascript">
	{literal}	
		var calendarObjForForm = new DHTMLSuite.calendar({minuteDropDownInterval:10,numberOfRowsInHourDropDown:5,callbackFunctionOnDayClick:'getDateFromCalendar',isDragable:true,displayTimeBar:false}); 
		calendarObjForForm.setCallbackFunctionOnClose('myOtherFunction');
		
		function myOtherFunction()
		{
			
			
		}
		function pickDate(buttonObj,inputObject,myDate)
		{
			calendarObjForForm.setCalendarPositionByHTMLElement(inputObject,0,inputObject.offsetHeight+2);	// Position the calendar right below the form input
			calendarObjForForm.setInitialDateFromInput(inputObject,'dd.mm.yyyy');	// Specify that the calendar should set it's initial date from the value of the input field.
			calendarObjForForm.addHtmlElementReference(myDate,inputObject);	// Adding a reference to this element so that I can pick it up in the getDateFromCalendar below(myInput is a unique key)
			if(calendarObjForForm.isVisible()){
				calendarObjForForm.hide();
			}else{
				calendarObjForForm.resetViewDisplayedMonth();	// This line resets the view back to the inital display, i.e. it displays the inital month and not the month it displayed the last time it was open.
				calendarObjForForm.display();
			}		
		}	
		/* inputArray is an associative array with the properties
		year
		month
		day
		hour
		minute
		calendarRef - Reference to the DHTMLSuite.calendar object.
		*/
		function getDateFromCalendar(inputArray)
		{
			var references = calendarObjForForm.getHtmlElementReferences(); // Get back reference to form field.
			references.expires_date.value = inputArray.day  + '.' + inputArray.month + '.' + inputArray.year;
			calendarObjForForm.hide();	
			
		}
		{/literal}	
		</script>
<div class="wrap">

<div id='adddspecial_ajaxResponse' class="ajaxResponse"></div>
<h2>{TranslateTag}B_LABEL_CREATE_SPECIAL_PRODUCT{/TranslateTag}</h2>

	<form name="addspecial" id="addspecial" method="post">
	<input type="hidden" name="act" value="addspecial" />
	<table class="adminform" width="100%" cellspacing="2" cellpadding="5">
		<tr>
			<th scope="row" valign="top">
			<label for="product_id">{TranslateTag}B_LABEL_PRODUCT_NAME{/TranslateTag}:</label></th>
			<td>        
	  			<select name='product_id' id='product_id' class='postform' onchange="OnGetImage('?{$smarty.server.QUERY_STRING}',this,'showimage');">
	  				<option value='0'>None</option>
		  			{foreach name=product_id from=$PRODUCTS item=item}
						<option id='product_id-{$item->product_id}' class="{cycle values=,alternate}" value='{$item->product_id}'>
						{$item->product_name} ({$item->product_price} {$item->symbol_left})
					</option>
                    {/foreach}
				</select>
	  		</td>
		</tr>
        <tr>
			<th width="33%" scope="row" valign="top">
			<label for="specials_new_products_price">{TranslateTag}B_LABEL_PRODUCT{/TranslateTag}:</label></th>
			<td width="67%" id="showimage">
				<img src="{$THESPECIAL->product_thumbnail}" />
            </td>
		</tr>
		<tr>
			<th width="33%" scope="row" valign="top">
			<label for="specials_new_products_price">{TranslateTag}B_LABEL_NEW_PRICE{/TranslateTag}:</label></th>
			<td width="67%">
			<input name="specials_new_products_price" id="specials_new_products_price" type="text" value="" size="50" /></td>
		</tr>
		<tr>
			<th width="33%" scope="row" valign="top">
			<label for="expires_date">Expires Date:</label></th>
			<td width="67%">
				<input type="text" name="expires_date" value="" id="expires_date" size="30" minLength="10" maxlength="10"/>
                <input type="button" value="" class="dateofbirth" onclick="pickDate(this,document.getElementById('expires_date'),'expires_date');">
               </td>
		</tr>
		<tr>
			<th width="33%" scope="row" valign="middle">
			<label for="status">{TranslateTag}B_LABEL_DISPLAY{/TranslateTag}</label></th>
			<td width="67%">
			<input name="status" id="status" type="checkbox" value="1"/>
			</td>
		</tr>
	</table>
	<p class="submit" align = "right">
		<input type="image" name="submit" src="../view/admin/images/object_save.png" value="" />
	</p>
</form>

</div>
<script type="text/javascript">
{literal}
   	Calendar.setup({
    	inputField     :    "expires_date",     // id of the input field
        ifFormat       :    "%d.%m.%Y",     // format of the input field
        button         :    "btn_expires_date",  // trigger for the calendar (button ID)
        //align          :    "Tl",           // alignment (defaults to "Bl")
        singleClick    :    true,
		showsTime      :    true,
		timeFormat     :    "24",
		step           :    1  
    	});
{/literal}		
</script>    